﻿using System.Globalization;
using System.Windows.Data;

namespace DimensionsHelper.Client.Converters;

public class BooleanToVisibilityCollapsedConverter : IValueConverter
{
    public static BooleanToVisibilityCollapsedConverter Instance => new();


    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value is true)
        {
            return Visibility.Visible;
        }

        return Visibility.Collapsed;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value is Visibility.Visible)
        {
            return true;
        }

        return false;
    }
}